import threading
import time

def main(name):
    print('线程%s 开始' % name)
    time.sleep(5)
    print('线程%s 结束' % name)


if __name__ == '__main__':
    threads = []
    thread_name = ['1', '2', '3']
    for name in thread_name:
        t = threading.Thread(target=main, args=(name,))
        t.start()
        threads.append(t)
    for thread in threads:
        thread.join()